package tdd.refactor;

public class TaxiFeeModelExtra {
	protected int secondMiles;
	protected double pricePerMileSec;
	protected double pricePerMile;
	/**
	 * @param secondMiles
	 * @param pricePerMileSec
	 */
	public TaxiFeeModelExtra(TaxiFeeModel model, int secondMiles) {
		this.pricePerMile = model.pricePerMile;
		this.secondMiles = secondMiles;
	}
	
	private void initDaylightCharge(TimeFee timeFee) {
		this.pricePerMileSec = timeFee.daylightPricePerMileSec;
	}
	
	private void initNightCharge(TimeFee timeFee) {
		this.pricePerMileSec = timeFee.nightPricePerMileSec;
	}	
	
	public void init(int time, TimeFee timeFee, TaxiFeeModel model, JudgeTime judgeTime) {
		if(judgeTime.isDaylight(time, model)) {
			initDaylightCharge(timeFee);
		} else {
			initNightCharge(timeFee);
		}				
	}

}
